package com.miniprogram.common.enums;

/**
 * 优惠券类型
 *
 * @author lin
 * @Date 2019年12月31日
 */
public enum CouponTypeEnum {

    // 小时房
    HOUR(1, "小时房"),
    // 日房
    DAY(2, "过夜房");

    private Integer code;

    private String description;

    CouponTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static String getValueByCode(Integer code) {
        if (code == null) {
            return "";
        }
        for (CouponTypeEnum enums : CouponTypeEnum.values()) {
            if (enums.code.equals(code)) {
                return enums.description;
            }
        }
        return "";
    }

    public String getDescription() {
        return description;
    }
}
